package cn.zhentao.charge.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.zhentao.charge.mapper.ChargeStationGunMapper;
import cn.zhentao.charge.domain.ChargeStationGun;
import cn.zhentao.charge.service.IChargeStationGunService;

/**
 * 充电枪Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-15
 */
@Service
public class ChargeStationGunServiceImpl implements IChargeStationGunService 
{
    @Autowired
    private ChargeStationGunMapper chargeStationGunMapper;

    /**
     * 查询充电枪
     * 
     * @param id 充电枪主键
     * @return 充电枪
     */
    @Override
    public ChargeStationGun selectChargeStationGunById(Integer id)
    {
        return chargeStationGunMapper.selectChargeStationGunById(id);
    }

    /**
     * 查询充电枪列表
     * 
     * @param chargeStationGun 充电枪
     * @return 充电枪
     */
    @Override
    public List<ChargeStationGun> selectChargeStationGunList(ChargeStationGun chargeStationGun)
    {
        return chargeStationGunMapper.selectChargeStationGunList(chargeStationGun);
    }

    /**
     * 新增充电枪
     * 
     * @param chargeStationGun 充电枪
     * @return 结果
     */
    @Override
    public int insertChargeStationGun(ChargeStationGun chargeStationGun)
    {
        chargeStationGun.setCreateTime(DateUtils.getNowDate());
        return chargeStationGunMapper.insertChargeStationGun(chargeStationGun);
    }

    /**
     * 修改充电枪
     * 
     * @param chargeStationGun 充电枪
     * @return 结果
     */
    @Override
    public int updateChargeStationGun(ChargeStationGun chargeStationGun)
    {
        return chargeStationGunMapper.updateChargeStationGun(chargeStationGun);
    }

    /**
     * 批量删除充电枪
     * 
     * @param ids 需要删除的充电枪主键
     * @return 结果
     */
    @Override
    public int deleteChargeStationGunByIds(Integer[] ids)
    {
        return chargeStationGunMapper.deleteChargeStationGunByIds(ids);
    }

    /**
     * 删除充电枪信息
     * 
     * @param id 充电枪主键
     * @return 结果
     */
    @Override
    public int deleteChargeStationGunById(Integer id)
    {
        return chargeStationGunMapper.deleteChargeStationGunById(id);
    }
}
